<!--数据维护-->
<div class="dept-supervision-container w100 h100">
  <div class="content-box">
    <div class="table-top-search">
      <div class="top-search-left">
        <button nz-button nzType="primary" (click)="dataBf()">
          <i nz-icon nzType="plus" nzTheme="outline"></i>数据备份
        </button>
        <button nz-button nzType="default"
                nz-popconfirm
                nzOkType="danger"
                nzTitle="确定删除所选数据吗?"
                (nzOnCancel)="cancelFn()"
                (nzOnConfirm)="deleteAll()"
                [disabled]="canDelete"
                nzPlacement="top"
        >
          <i nz-icon nzType="delete" nzTheme="outline"></i>批量删除
        </button>
        <button nz-button nzType="primary" (click)="aicgo()">
          <i nz-icon nzType="interation" nzTheme="outline"></i>AIC->中间库
        </button>
        <button nz-button nzType="primary" (click)="middlego()">
          <i nz-icon nzType="interation" nzTheme="outline"></i>中间库->业务库
        </button>
      </div>
      <div class="top-search-right">
        <label>
          文件名:
          <input type="text" nz-input [(ngModel)]="fileNameSearch" placeholder="请输入">
        </label>
        <div class="table-top-btn">
          <button nz-button nzType="primary" (click)="clickSearch()">查询</button>
          <button nz-button nzType="default" (click)="resetSearch()">重置</button>
        </div>
      </div>
    </div>
    <div class="table-box">
      <ng-template #totalTemplate let-total>总共 {{ pageInfo.totalRecords? pageInfo.totalRecords:0 }} 条</ng-template>
      <nz-table
        nzBordered
        [nzData]="dataList"
        [nzFrontPagination]="false"
        [nzShowPagination]="true"
        [nzPageIndex]="pageInfo.first"
        [nzTotal]="pageInfo.totalRecords"
        [nzShowTotal]="totalTemplate"
        [nzPageSize]="pageInfo.rows"
        [nzLoadingDelay]="1"
        [nzPageSizeOptions]="[10,20,30,50,100]"
        [nzShowQuickJumper]="true"
        [nzShowSizeChanger]="true"
        (nzPageIndexChange)="changePageIndex($event)"
        (nzPageSizeChange)="changePageSize($event)"
      >
        <thead>
        <tr>
          <th class="tableCheck"
              nzShowCheckbox
              [(nzChecked)]="isAllCheck"
              [nzIndeterminate]="isIndeterminate"
              (nzCheckedChange)="checkAll($event)"
          ></th>
          <th nzWidth="60px">序号</th>
          <th>文件名</th>
          <th>大小</th>
          <th>备份时间</th>
          <th>备注</th>
          <th nzWidth="100px">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let item of dataList; let i = index">
          <td
            nzShowCheckbox
            [(nzChecked)]="mapOfCheckedId[item.id]"
            (nzCheckedChange)="refreshStatus()"
          ></td>
          <td>{{i + 1}}</td>
          <td>{{item.fileName}}</td>
          <td>{{item.fileSize}}</td>
          <td>{{item.createTime}}</td>
          <td>{{item.content}}</td>
          <td>
            <span class="operaFont firOpera" (click)="backdata(item)">恢复</span>
            <span class="operaFont operaTao"
                  nz-popconfirm
                  nzOkType="danger"
                  nzTitle="确定删除该数据吗?"
                  (nzOnConfirm)="clickDelete(item.id)"
                  nzPlacement="top"
            >删除</span>
          </td>
        </tr>
        </tbody>
      </nz-table>
    </div>
  </div>
</div>

<!--数据备份-->
<nz-modal [(nzVisible)]="isVisible"
          nzWidth="600px"
          [nzTitle]="modalTitle"
          [nzContent]="modalContent"
          (nzOnCancel)="isVisible = false"
          [nzFooter]="footModel"
          nzMaskClosable="false"
>
  <ng-template #modalTitle>
    <span>数据备份</span>
  </ng-template>
  <ng-template #modalContent>
    <div style="min-height: 200px;width: 90%;margin: 20px auto 0;">
      <div style="margin-bottom: 30px">
        <span style="display:inline-block; width: 18%;text-align: right"><span style="color: red">*</span>文件名：</span>
        <input type="text" style="width: 82%" nz-input [(ngModel)]="fileName" placeholder="请输入">
      </div>
      <div>
        <span style="display:inline-block; width: 18%;text-align: right">备注：</span>
        <textarea style="width: 82%;vertical-align: middle" nz-input rows="3" placeholder="请输入" [(ngModel)]="remark"></textarea>
      </div>
    </div>
  </ng-template>
  <ng-template #footModel>
    <button nz-button nzType="default" (click)="isVisible = false">取消</button>
    <button nz-button nzType="primary" (click)="submit()" [disabled]="!fileName">保存</button>
  </ng-template>
</nz-modal>
